package com.aloda.ojquestion.pojo.vo;

import cn.hutool.core.bean.BeanUtil;
import com.aloda.ojcommon.domain.entity.QuestionSubmit;
import lombok.Data;

import java.time.LocalDateTime;

/**
 * @Author aloda
 * @Date 2025/4/28 20:47
 */
@Data
public class QuestionSubmitDetailVO {

    /**
     * id
     */
    private Long id;

    /**
     * 编程语言
     */
    private String submitLanguage;

    /**
     * 用户代码
     */
    private String submitCode;

    /**
     * 判题信息（json 对象）
     */
    private String judgeInfo;

    /**
     * 判题状态（0 - 待判题、1 - 判题中、2 - 成功、3 - 失败）
     */
    private Integer submitStatus;

    /**
     * 题目 id
     */
    private Long questionId;

    /**
     * 创建用户 id
     */
    private Long userId;

    /**
     * 创建时间
     */
    private LocalDateTime createTime;

    /**
     * 更新时间
     */
    private LocalDateTime updateTime;

    public static QuestionSubmitDetailVO of(QuestionSubmit questionSubmit) {
        QuestionSubmitDetailVO questionSubmitDetailVO = BeanUtil.toBeanIgnoreError(questionSubmit, QuestionSubmitDetailVO.class);
        return questionSubmitDetailVO;
    }
}
